<?php

/**
 * Error Message Class to handle alll message types and codes
 *
 * @package SGN_Core
 * @version $Id: Application.php 1424 2012-03-03 08:15:52Z locth $
 * @author $Author: trangvtt $
 *
 */
require_once 'Predis/Autoloader.php';
class SGN_Redis
{
    static $redisClient;
    static function getRedis($options){
        if(self::$redisClient[serialize($options)]){
            return self::$redisClient[serialize($options)];
        }
        Predis\Autoloader::register();
        $client = new Predis\Client($options);
        $connection = $client->getConnection();
        self::$redisClient[serialize($options)] = $client;
        return $client;
    }
}